package com.moon.game.command.guest.gift;

import java.util.List;

import com.moon.game.command.BaseCmd;
import com.moon.game.command.RequestSession;
import com.moon.game.exception.GException;
import com.moon.game.vos.GiftVo;
import com.moon.game.vos.PlayerVo;

/**
 * @description 查看我的礼包
 * @author Ranger 作者 E-mail:haozi000005@163.com
 * @version 创建时间：2012-8-7 下午3:58:19
 */
public class ShowGiftsCmd extends BaseCmd {

	@Override
	protected void runOnce(RequestSession req) throws GException {
		switch (req.getStatus()) {
			case STATU_INIT:
				doInit(req);
				break;
			case STATU_CHECK:
				doCheckSelf(req);
				break;
			case STATU_RETURN:
				doResponse(req);
				break;
			default:
				break;
		}
	}

	@Override
	protected void doResponse(RequestSession req) throws GException {
		PlayerVo player = getPlayerVo(req);
		List<GiftVo> giftList = player.getGiftList();
//		GiftService.addGift(req.getSid(), req.getPlayerId(), Constants.NEW_GIFT);
		req.setVO("gift_list", giftList);
		response(req, req.getClientResponse());
	}

}
